Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Adds kernel menu to control kernel #282

Closed
wants to merge 3 commits into from

Conversation

AlexandreSajus
Copy link
Contributor

@AlexandreSajus AlexandreSajus commented Feb 19, 2022

image

fixes #274

@AlexandreSajus AlexandreSajus added the enhancement New feature or request label Feb 19, 2022
@AlexandreSajus AlexandreSajus self-assigned this Feb 19, 2022
@MathisFederico MathisFederico linked an issue Feb 19, 2022 that may be closed by this pull request
Comment on lines 602 to 620
def stop_kernel(self):
"""Stop the kernel."""
current_window = self.activeMdiChild()
if current_window is not None:
current_window.scene.kernel.stop()
self.reset_block_states()
self.statusbar.showMessage("Kernel stopped")
else:
self.statusbar.showMessage("No active window")

def restart_kernel(self):
"""Restart the kernel."""
current_window = self.activeMdiChild()
if current_window is not None:
current_window.scene.kernel.restart()
self.reset_block_states()
self.statusbar.showMessage("Kernel restarted")
else:
self.statusbar.showMessage("No active window")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those functions are nearly the same, try to reduce duplication by using an other (private) method

@AlexandreSajus
Copy link
Contributor Author

Restarting the kernel introduces weird bugs.

For example:
image

I ran A then restarted the kernel and ran B. B should output an error but does not.

Plus I would need to reset the kernel CWD every time I restart the kernel which means accessing saving_path from where I restart the kernel.

I am closing this PR for the time being

@MathisFederico
Copy link
Member

That's sad, this would be a very nice feature :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interrupt & restart Ipython kernel Creating a new window is too long
2 participants